home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / Other / power / README < prev    next >
Encoding:
Text File  |  1992-05-09  |  2.5 KB  |  75 lines

  1. Setting automatically the power on time on NeXT Computers
  2. =========================================================
  3.  
  4. Enclosed you find some programs for setting the auto-power-on time
  5. automatically under program control without using the Preferences Application.
  6.  
  7. Only some NeXTs with a special version of RTC Chip are able to power themself
  8. on at a certain time. If there is a PopUp button in the Startup Preferences
  9. (in the Preferences Apllication) with "Startup Device" and "Power", you are 
  10. one of the lucky. The people who don't have this feature don't normally miss 
  11. it; it's nearly undocumented.
  12.  
  13.  
  14.  
  15. The programs are:
  16.  
  17. setpwr    setting the next power on time and enable/disable it
  18.         usage: setpwr [-on|-off] t_time
  19.         t_time are seconds since 1 Jan 1970
  20.                 
  21. getpwr    getting the next power on time test if it is enabled
  22.         usage: getpwr
  23.         print next power on time in seconds since 1 Jan 1970 to
  24.         stdout and return 0 if power on is enabled and 1 if disabled
  25.         
  26. getdate converts a human-readable date/time to time since epoch (number of
  27.         seconds since 1 Jan 1970)
  28.  
  29. ctime    converts seconds since 1 Jan 1970 into a human-readable form
  30.  
  31. see also man pages for ctime(1), ctime(3), getdate(1), getdate(3)
  32.  
  33.  
  34.  
  35. How to achieve a daily power on?
  36.  
  37. setpwr only sets the power time once. If you want to power on you NeXT every
  38. day automatically, you have to do it via cron or even better, via /etc/halt.
  39.  
  40. Each time the NeXT is powered down (with the power key or with shutdown -h -p) 
  41. /etc/halt is executed. Therefore this is a good place for setting the next 
  42. power on time.
  43.  
  44. Rename /usr/etc/halt to /usr/etc/halt.dist and put this or a similar script
  45. into /usr/etc/halt instead:
  46.  
  47.  
  48. #!/bin/csh
  49. #
  50. set LOGFILE = /usr/adm/power.log
  51. #
  52. echo `date` halt: $* >>$LOGFILE
  53. /usr/local/etc/setpower  >>$LOGFILE
  54. /usr/etc/halt.dist $*
  55.  
  56.  
  57. /usr/local/etc/setpower is the script that comes with these programs. setpower 
  58. counts the old power on time in 86400 second (a day) increments to a 
  59. time > current time and sets the new power on time. You have to enable the 
  60. power on feature (via Preferences or via setpwr -on) in order to get the NeXT 
  61. to power on!
  62.  
  63. BTW: You have to be root to set the power on time!
  64.  
  65. Please regard the programs as is. I even didn't have the chance to test them 
  66. before distributing, because my new board does not have the right RTC chip!
  67.  
  68. Thanks to Reimer A. Mellin (ram@ramsys.sta.sub.org) who put my clumsy 
  69. assembler routines and his knowledge together in power.c!
  70.  
  71. Christian Baur
  72. cbaur@blabel.sta.sub.org (NeXTMail)
  73. cbaur@pst.informatik.uni-muenchen.de (NeXTMail)
  74.  
  75.